package com.hoshiicloud.user.entity.company;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.hoshiicloud.common.validate.ValidGroupUpdate;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 附件类型
 * </p>
 *
 * @author WGJ
 * @since 2019-04-22
 *
 * update by yangcheng at 2019-05-15 18:15:33
 * 增加验证注解以及swagger文档参数默认值
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class AttachmentType extends Model<AttachmentType>  {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("ID")
    @NotNull(message = "id不能为空",groups = {ValidGroupUpdate.class})
    private Long id;

    @ApiModelProperty("附件代码")
    private Long companyId;

    @NotBlank(message = "名称不能为空")
    @ApiModelProperty("附件名称")
    private String name;

    @ApiModelProperty("是否必须上传 1-必须 2-不限")
    @NotNull(message = "是否必须上传不能为空")
    @Pattern(regexp = "[12]",message = "是否必须上传,值只能传1或者2")
    private Integer required;

    @ApiModelProperty("示例图")
    @NotBlank(message = "示例图不能为空")
    private String exampleGraph;

    @NotNull(message = "是否可用不能为空")
    @ApiModelProperty("是否可用")
    private Integer enabled;

    @ApiModelProperty("描述")
    private String describe;

    @ApiModelProperty("创建时间")
    private LocalDateTime createdTime;


    @ApiModelProperty("创建人")
    private String createdBy;

    @ApiModelProperty("创建时间")
    private LocalDateTime updatedTime;


    @ApiModelProperty("创建人")
    private String updatedBy;

    @ApiModelProperty("是否删除: 0否 ; 1是")
    private Integer deleted;



    @Override
    protected Serializable pkVal() {
       return this.id;
    }
}
